Skip to content

Introduce custom QueryClient #468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed

Introduce custom QueryClient #468

wants to merge 18 commits into from

Conversation

paul-sachs
Copy link
Collaborator

@paul-sachs paul-sachs commented Oct 24, 2024

The new QueryClient introduces typesafe APIs to all the relevant queryClient APIs that you'd want to use.

This change can help alleviate the following issues: #467 #390 #391

@paul-sachs paul-sachs changed the base branch from main to psachs/connect-query-core October 24, 2024 17:58
@paul-sachs paul-sachs force-pushed the psachs/v2-query-client branch 2 times, most recently from 7fdd7f9 to 3647d72 Compare October 24, 2024 19:21
@paul-sachs paul-sachs changed the title Introduce custom QueryClient V2: Introduce custom QueryClient Oct 24, 2024
Base automatically changed from psachs/connect-query-core to v2 October 31, 2024 18:15
@paul-sachs paul-sachs changed the base branch from v2 to main November 15, 2024 20:59
@paul-sachs paul-sachs changed the base branch from main to v2 November 15, 2024 21:00
@paul-sachs paul-sachs force-pushed the psachs/v2-query-client branch from 7e10f7c to 8bc29eb Compare November 15, 2024 21:04
@paul-sachs paul-sachs changed the base branch from v2 to main November 15, 2024 21:05
@paul-sachs paul-sachs changed the base branch from main to v2 November 15, 2024 21:05
@paul-sachs paul-sachs changed the base branch from v2 to main November 15, 2024 21:09
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
@paul-sachs paul-sachs force-pushed the psachs/v2-query-client branch from a427255 to 3d5adc5 Compare November 15, 2024 21:13
Signed-off-by: Paul Sachs <psachs@buf.build>
@paul-sachs paul-sachs force-pushed the psachs/v2-query-client branch from 3d5adc5 to 38ca830 Compare November 15, 2024 21:14
@paul-sachs paul-sachs marked this pull request as ready for review November 15, 2024 21:15
@paul-sachs paul-sachs changed the title V2: Introduce custom QueryClient Introduce custom QueryClient Nov 20, 2024
@paul-sachs paul-sachs requested a review from timostamm November 20, 2024 16:40
paul-sachs and others added 7 commits January 6, 2025 13:13
Signed-off-by: Paul Sachs <11449728+paul-sachs@users.noreply.github.com>
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
…nit shape

Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
@paul-sachs
Copy link
Collaborator Author

@timostamm Moved in suggested changes from #518 into this PR instead. It does feel a lot better to have it integrated into the query client

Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
paul-sachs added a commit that referenced this pull request May 20, 2025
By adding DataTag annotations to the ConnectQueryKey, QueryClient
methods can now infer the return type when calling things like
`getQueryData` or `invalidateQueries`.

This is at least a partial alternative to #468 which provides better
inference abilities while keeping our api surface smaller. There may
still be value down the line with very well defined query client methods
but I suspect this change covers 90% of the current use cases.

---------

Signed-off-by: Paul Sachs <psachs@buf.build>
@paul-sachs
Copy link
Collaborator Author

Superseded by #532. Eventually there may be a place for a custom client but for most things, #532 will suffice with much less additional API surface.

@paul-sachs paul-sachs closed this May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants